using System;
using WeifenLuo.WinFormsUI.Docking;

namespace Pasys.PresentationCore.DockShell.SmartPartInfos
{
    public class DockStateShowStrategy : IShowStrategy
    {
        public DockStateShowStrategy(DockState dockState)
        {
            this.DockState = dockState;
        }

        public DockState DockState { get; set; }

        #region IShowStrategy Members

        void IShowStrategy.Show(IDockPanelWorkspace workspace, IDockContent content)
        {
            // Mapping of the enum
            var value = (int)DockState;
            var dockState =
                (WeifenLuo.WinFormsUI.Docking.DockState)Enum.ToObject(
                    typeof(WeifenLuo.WinFormsUI.Docking.DockState), value);

            content.DockHandler.Show(workspace.DockPanel, dockState);
        }

        #endregion
    }

}